import request from "@/config/request";
export const userLoginService = (registerData) => {
  const params = new URLSearchParams();
  for (let key in registerData) {
    params.append(key, String(registerData[key]));
  }
  return request.post("/login", params);
};
export const userRegisterService = (registerData) => {
  const params = new URLSearchParams();
  for (let key in registerData) {
    params.append(key, String(registerData[key]));
  }
  return request.post("/register", params);
};
export const resetPasswordService = (data) => {
  return request.put("/change", data, {
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
};

export const getUserListService = (data) => {
  return request.post("/user/getUserList", data);
};

export const deleteUserService = (id) => {
  return request.delete(`/user/deleteUser/${id}`);
};

export const addUserService = (data) => {
  return request.post("/user/add", data);
};
